package com.web.cms.doc.dao;

import com.blue.jdbc.BaseDao;
import com.web.cms.doc.model.DocComment;
import org.springframework.stereotype.Repository;

@Repository("cmsDocCommentDao")
public class DocCommentDao extends BaseDao<DocComment>
{
	public DocCommentDao()
	{
	}

	@Override
	protected void query(StringBuilder sql, DocComment param)
	{
		if (param != null)
		{
			if (param.getDocId() != null && param.getDocId() > 0)
				sql.append(" and a.doc_id=:docId");
			
			if (param.getUserId() != null && param.getUserId() > 0)
				sql.append(" and a.user_id=:userId");
			
		}
		sql.append(" order by a.id desc");
	}
	
}
